﻿Imports System.Web.UI.WebControls

Partial Class Search
	Inherits RoutablePage

	Protected Sub animals_Load(ByVal sender As Object, ByVal e As System.EventArgs)

		Dim filters = From v In RequestContext.RouteData.Values _
		  Select String.Format("contains(@{0},'{1}')", v.Key, v.Value)

		animals.XPath = "Animals/Animal[" + String.Join(" and ", filters.ToArray()) + "]"

	End Sub

End Class
